package serviceImpl;

import dao.CourseMapper;
import entity.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.CourseService;

import java.util.List;
@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;
    @Override
    public Course getCourseByCourseID(String courseID) {
        return courseMapper.getCourseByCourseID(courseID);
    }

    @Override
    public List<Course> getAllCourses() {
        return courseMapper.getAllCourses();
    }

    @Override
    public boolean updateCourse(Course course) {
        return courseMapper.updateCourse(course);
    }

    @Override
    public boolean deleteCourse(String courseID) {
        return courseMapper.deleteCourse(courseID);
    }

    @Override
    public boolean addCourse(Course course) {
        return courseMapper.addCourse(course);
    }

    @Override
    public List<Course> getCourseByCourseIDORCourseName(String courseID, String courseName) {
        return courseMapper.getCourseByCourseIDORCourseName(courseID,courseName);
    }
}
